package main

import (
	maker2 "api/libs/maker"
	"gitee.com/dreamwood/ez-maker/maker"
)

func main() {
	maker2.Prepare()
	ComSn()
	ComSnLog()
	ComSnRule()
}

func ComSn() {
	c := maker.CreateTable("ComSn", "单号", "tools")
	c.AddText("name", "名称").SetNullable(true).SetLength(255)
	c.AddText("text", "规则").SetNullable(true).SetLength(255)
	c.AddText("service", "所属服务").SetNullable(true).SetLength(255)
	c.Generate()
}

func ComSnLog() {
	c := maker.CreateTable("ComSnLog", "单号记录", "tools")
	c.AddManyToOne("sn", "SN", "ComSn").SetNullable(true)
	c.AddText("type", "类型").SetNullable(true).SetLength(255)
	c.AddText("value", "当前值").SetNullable(true).SetLength(255)
	c.AddText("typeValue", "类型值").SetNullable(true).SetLength(255)
	c.Generate()
}

func ComSnRule() {
	c := maker.CreateTable("ComSnRule", "单号规则", "tools")
	c.AddText("name", "中文注释名").SetNullable(true).SetLength(255)
	c.AddText("code", "规则码").SetNullable(true).SetLength(255)
	c.AddText("attrChain", "实际调用属性").SetNullable(true).SetLength(255)
	c.Generate()
}
